#pragma once
//#ifndef xxx //#if !defined(xxx)
//#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#define LINE_SIZE 1024
#define FLUSH_NOW 1
#define FLUSH_LINE 2
#define FLUSH_FULL 4

struct myFILE
{
    unsigned int flag_flush;//标志
    int fileno;//文件标识符
    //缓冲区
    char cache[LINE_SIZE];
    int cap;
    int pos;//下一个位置
};

typedef struct myFILE myFILE;

myFILE* my_fopen(const char* path, const char* flag_user);
void my_fflush(myFILE* fp);
ssize_t my_fwrite(myFILE* fp, const char* data, int len);
void my_fclose(myFILE* fp);
